export function phoneFormat(value) {
  if (!value) return '';
  return value.replace(/(\d{3})\d*(\d{4})/, '$1****$2');
}
export function idCardFormat(value) {
  if (!value) return '';
  return value.replace(/(\d{3})\d*(\d{4})/, '$1******$2');
}
export function nameFormat(value, length = 1) {
  if (!value) return '';
  const asterisk = '*'.padEnd(length, '*');
  return value.replace(new RegExp(`(\\w{1})\\w*(\\w{1})`), `$1${asterisk}$2`);
}
